package array;

public class arraydemo6 {
    public static void main(String[] args) {
        int[] arr = {13, 21, 42, 50, 3};
        int i;
        for (i = 0; i < arr.length - 1; i++) {
            int temp = 0;
            for (int j = 0; j < arr.length - i - 1; j++) {
                if (arr[j] > arr[j + 1]) {
                    temp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = temp;
                }
            }
        }
        for (i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);

        }
    }
}
